<template>
	<view class="box">
		<view class="top" :style="{height:marginNavTop,top:0}">
			<view class="navbar" :style="{paddingTop:statusBarHeight,height:statusNavHeight}">
				<view class="navTop" :style="{height:statusNavHeight}">
					<view class="left">
						<!-- <image class="image" src="../../static/img/back.svg" mode=""></image> -->
					</view>
					<view class="center">
						标题
					</view>
					<view class="right">

					</view>
				</view>
			</view>
		</view>
		<view class="bottom" :style="{paddingTop:marginNavTop}">
			<view class="swiperBox">
				<u-swiper indicator indicatorMode="line" circular :list="list1" height='160'></u-swiper>
			</view>
			<view class="searchBox">
				<view class="inputBox">
					<view class="inputBoxLeft">
						<image src="/static/img/din.svg" mode=""></image>
						杭州
					</view>
					<view class="inputBoxRight">
						<u-search placeholder="搜索活动/城市" v-model="keyword" bgColor='#fff' :showAction='false'></u-search>
					</view>
				</view>
			</view>
			<u-divider></u-divider>
			<view class="centerBox">
				<view class="cardBox" v-for="item in 4" :key="item" @click="toDetail(item)">
					<view class="cardBoxLeft">
						<image
							src="https://test-1308258046.cos.ap-beijing.myqcloud.com/store/upload/1742438838740339543.png"
							mode=""></image>
					</view>
					<view class="cardBoxRight">
						<view class="name">
							homeBar名字
						</view>
						<view class="content">
							这是一大段活动内容这是一大段活动内容这是一大段活动内容
						</view>
						<view class="btnBox">
							<view class="price">
								¥<view class="q">
									299
								</view>元起
							</view>
							<view class="btn">
								我要去!
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: 0,
				statusNavHeight: 0,
				marginNavTop: 0,

				list1: [
					'https://test-1308258046.cos.ap-beijing.myqcloud.com/store/upload/1742437272396294512.png',
					'https://test-1308258046.cos.ap-beijing.myqcloud.com/store/upload/1742439877066375635.png'
				],
				keyword: ''
			}
		},
		created() {
			this.statusBarHeight = getApp().globalData.statusBarHeight + 'px'
			this.statusNavHeight = getApp().globalData.statusNavHeight + 'px'
			this.marginNavTop = (getApp().globalData.statusBarHeight + getApp().globalData.statusNavHeight + 6) + 'px'
		},
		onReachBottom() {
			console.log('到底还在出发');
		},
		onLoad(option) {
			console.log(option, '传递的参数');
		},
		methods: {
			goBack() {
				uni.navigateBack()
			},
			toDetail(item) {
				console.log(item);
				uni.navigateTo({
					url: '/pages/activityDetails/activityDetails'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.box {
		width: 100%;
		height: 100%;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;

		.top {
			width: 100%;
			display: flex;
			flex-direction: column;
			box-sizing: border-box;
			position: fixed;
			z-index: 5;
			background-color: #fff;

			.navbar {
				width: 100%;
				// border: 2rpx solid red;
				box-sizing: border-box;
			}

			.navTop {
				width: 100%;
				display: flex;

				.left {
					width: 180rpx;
					height: 100%;
					box-sizing: border-box;
					padding-left: 40rpx;

					.image {
						width: 64rpx;
						height: 64rpx;
					}
				}

				.center {
					display: flex;
					align-items: center;
					justify-content: center;
					flex: 1;
					font-family: 思源黑体;
					font-size: 38rpx;
					font-weight: 500;
					letter-spacing: 0rpx;
					color: #000000;
				}

				.right {
					width: 180rpx;
					height: 100%;
				}
			}

		}

		.bottom {
			flex: 1;
			width: 100%;

			display: flex;
			flex-direction: column;
			background-color: #fff;

			padding-bottom: 30rpx !important;
			// border: 1px solid red;

			.swiperBox {
				width: 100%;
				height: 160px;
				// border: 1px solid;
				margin-top: 10px;
				box-sizing: border-box;
				padding: 0 10px;
			}

			.searchBox {
				height: 46px;
				width: 100%;
				border-radius: 6px;
				margin-top: 16px;
				box-sizing: border-box;
				padding: 0 20rpx;

				.inputBox {
					width: 100%;
					height: 100%;
					background-color: #FFE655;
					border-radius: 6px;
					box-sizing: border-box;
					padding: 0 10px;
					display: flex;
					align-items: center;

					.inputBoxLeft {
						font-size: 14px;
						display: flex;
						align-items: center;

						image {
							height: 14px;
							width: 14px;
							margin-right: 4px;
						}
					}

					.inputBoxRight {
						flex: 1;
						height: 80%;
						margin-left: 25px;
						display: flex;
						align-items: center;
					}
				}
			}


			.centerBox {
				flex: 1;
				width: 100%;
				box-sizing: border-box;
				padding: 0 10px;
				display: flex;
				flex-direction: column;

				.cardBox {
					width: 100%;
					height: 120px;
					margin-bottom: 10px;
					border-radius: 6px;
					display: flex;
					align-items: center;
					background-color: #f7f8fa;

					.cardBoxLeft {
						height: 120px;
						width: 120px;
						border-radius: 6px;
						box-sizing: border-box;

						image {
							height: 120px;
							width: 120px;
							border-radius: 6px;
						}
					}

					.cardBoxRight {
						flex: 1;
						height: 100%;
						box-sizing: border-box;
						// padding: 5px 0;
						margin-left: 16px;
						display: flex;
						flex-direction: column;
						justify-content: space-evenly;

						.name {
							font-family: Roboto;
							font-size: 18px;
							font-weight: 500;
							color: #1F2937;
						}

						.content {
							font-family: Roboto;
							font-size: 12px;
							font-weight: normal;
							color: #6B7280;
							box-sizing: border-box;
							padding-right: 26px;
						}

						.btnBox {
							display: flex;
							align-items: center;
							justify-content: space-between;
							box-sizing: border-box;
							padding-right: 10px;

							.price {
								font-family: Roboto;
								font-size: 15px;
								font-weight: 500;
								color: red;
								display: flex;
								align-items: flex-end;

								.q {
									font-size: 18px;
									font-weight: 500;
								}
							}

							.btn {
								width: 70px;
								height: 30px;
								border-radius: 6px;
								background: #3B82F6;

								display: flex;
								align-items: center;
								justify-content: center;
								font-family: Roboto;
								font-size: 14px;
								font-weight: normal;
								color: #FFFFFF;
							}
						}
					}
				}
			}
		}
	}
</style>